var limsBatchRevise = Gikam.getPageObject({

    getEditListColumns : function() {
        return [ {
            checkbox : true
        }, {index: true}, Gikam.status.getBpmnColumn(limsBatchRevise.workflow.dbTable),/*{
            field : 'status',
            title : 'T_LIMS_BATCH.STATUS',
            type : 'select',
            category : 'sys',
            param : {
                codeCategoryId_EQ : 'reviseStatus'
            },
        },*/ {
            field : 'batchCode',
            title : 'T_LIMS_BATCH.BATCHCODE',
            type : 'link'
        }, {
            field : 'batchType',
            title : 'T_LIMS_BATCH.BATCHTYPE',
            type : 'select',
            firstBlank : false,
            category : 'batchType',
        }, {
            field : 'reviseType',
            title : 'T_LIMS_BATCH_REVISE.BATCHTYPE',
            validators : [ 'notEmpty' ],
            type : 'select',
            category : 'sys',
            firstBlank : false,
            param : {
                codeCategoryId_EQ : 'reviseType'
            },
        },  {
            field : 'createdByName',
            title : 'T_LIMS_BATCH.CREATEDBYNAME',
        }, {
            field : 'createdTime',
            title : 'T_LIMS_BATCH.CREATEDTIME',
        } ];
    },

    getSearchListColumns : function() {
        return [ {
            checkbox : true
        }, {index: true},Gikam.status.getBpmnColumn(limsBatchRevise.workflow.dbTable),/*{
            field : 'status',
            title : 'T_LIMS_BATCH.STATUS',
            type : 'select',
            category : 'sys',
            param : {
                codeCategoryId_EQ : 'reviseStatus'
            },
        },*/ {
            field : 'batchCode',
            title : 'T_LIMS_BATCH.BATCHCODE',
            type : 'link'
        }, {
            field : 'batchType',
            title : 'T_LIMS_BATCH.BATCHTYPE',
            type : 'select',
            firstBlank : false,
            category : 'batchType',
        }, {
            field : 'reviseType',
            title : 'T_LIMS_BATCH_REVISE.BATCHTYPE',
            validators : [ 'notEmpty' ],
            type : 'select',
            category : 'sys',
            firstBlank : false,
            param : {
                codeCategoryId_EQ : 'reviseType'
            },
        },  {
            field : 'createdByName',
            title : 'T_LIMS_BATCH.CREATEDBYNAME',
        }, {
            field : 'createdTime',
            title : 'T_LIMS_BATCH.CREATEDTIME',
        } ];
    },

    getBaseInfoFormFields : function() {
        return [{
            field : 'reviseType',
            title : 'T_LIMS_BATCH_REVISE.BATCHTYPE',
            type : 'select',
            category : 'sys',
            firstBlank : false,
            param : {
                codeCategoryId_EQ : 'reviseType'
            },
            preInsert : true
        },  {
            field : 'batchCode',
            title : 'T_LIMS_BATCH.BATCHCODE',
            preInsert : true,
            type : 'choose',
            category : 'batch-choose',
            single : true,
            onBeforeChoose: function () {
                let reviseType = this.getData().reviseType;
                if(Gikam.isEmpty(reviseType)) {
                    return false
                }
                return {
                    status_EQ: 'done',
                    reviseFlag_EQ: '0',
                    reviseType: reviseType,
                    createdById_EQ: workspace.user.id,
                }
            },
            onAfterChoose : function (rows, index) {
                if (rows){
                    this.setData({
                        batchId : rows[0].id,
                        batchCode : rows[0].batchCode
                    })
                }
            }
        }];
    },

    getSampleListTempColumns: function() {
        return [ {
            checkbox : true
        }, {index: true},{
            field: 'sampleCode',
            title: 'T_LIMS_SAMPLE.SAMPLECODE',
            validators : [ 'notEmpty' ],
            width: 140,
            type : 'link',
        }, {
            field: 'sampleType',
            title: 'T_LIMS_SAMPLE.SAMPLETYPE',
            validators : [ 'notEmpty' ],
            width: 140,
        }, {
            field: 'ext$.productnames',
            title: 'T_LIMS_PRODUCT_MAIN.PRODUCTNAME',
            validators : [ 'notEmpty' ],
            width: 170,
        }, {
            field: 'sampleName',
            title: 'T_LIMS_SAMPLE.SAMPLENAME',
            validators : [ 'notEmpty' ],
            width: 140,
        }, {
            field: 'subjectId',
            title: 'T_LIMS_SAMPLE.SUBJECTID',
            validators : [ 'notEmpty' ],
            width: 140,
        }, {
            field: 'sampleSize',
            title: 'T_LIMS_SAMPLE.SAMPLESIZE',
            validators : [ 'notEmpty' ],
            width: 140,
        }, {
            field: 'samplingPosition',
            title: 'T_LIMS_SAMPLE.SAMPLINGPOSITION',
            validators : [ 'notEmpty' ],
            width: 140,
        }, {
            field: 'identifyCode',
            title: 'T_LIMS_SAMPLE.IDENTIFYCODE',
            validators : [ 'notEmpty' ],
            width: 140,
        }, {
            field: 'birthday',
            title: 'T_LIMS_SAMPLE.BIRTHDAY',
            validators : [ 'notEmpty' ],
            type: 'date',
            width: 140,
        }, {
            field: 'age',
            title: 'T_LIMS_SAMPLE.AGE',
            validators : [ 'notEmpty' ],
            width: 140,
        }, {
            field: 'gender',
            title: 'T_LIMS_SAMPLE.GENDER',
            validators : [ 'notEmpty' ],
            width: 140,
        }, /*{
            field: 'customerCode',
            title: 'T_LIMS_SAMPLE.CUSTOMERCODE',
            width: 140,
        }, */{
            field: 'customerName',
            title: 'T_LIMS_SAMPLE.CUSTOMERCODE',
            width: 140,
        }, {
            field: 'department',
            title: 'T_LIMS_SAMPLE.DEPARTMENT',
            width: 140,
        }, {
            field: 'remark',
            title: 'T_LIMS_SAMPLE.REMARK',
            width: 140,
        }]
    },

    getLogisticsListTempColumns : function() {
        return [{
            checkbox: true
        },{
            index: true
        }, {
            field: 'sampleCode',
            title: 'T_LIMS_SAMPLE.SAMPLECODE',
            width: 140,
            type : 'link'
        }, {
            field: 'temperatureLimits',
            title: 'T_LIMS_SAMPLE.TEMPERATURELIMITS',
        }, {
            field: 'senderName',
            title: 'T_LIMS_SAMPLE.SENDERNAME',
        }, {
            field: 'senderPhone',
            title: 'T_LIMS_SAMPLE.SENDERPHONE',
            width: 140,
        }, {
            field: 'courierNumber',
            title: 'T_LIMS_SAMPLE.COURIERNUMBER',
            width: 140,
        }, {
            field: 'courier',
            title: 'T_LIMS_SAMPLE.COURIER',
            width: 140,
        }, {
            field: 'senderRemark',
            title: 'T_LIMS_SAMPLE.SENDERREMARK',
        }]
    },

    baseUrl : IFM_CONTEXT + '/secure/basemodule/business/batch-revises',
    batchSampleTempUrl : IFM_CONTEXT + '/secure/basemodule/business/batch-sample-temps',
    batchSampleProductTempUrl : IFM_CONTEXT + '/secure/basemodule/business/batch-sample-product-temps',
    sampleTempUrl : IFM_CONTEXT + '/secure/basemodule/business/sample-temps',


    workflow: {
        dbTable: 'T_LIMS_BATCH_REVISE',
        columns: [{
            field: 'id',
            title: 'T_LIMS_BATCH_REVISE.ID'
        }]
    },
});
